import re
from subprocess import getstatusoutput

info = getstatusoutput("wmic nicconfig GET INDEX,DefaultIPGateway,IPAddress")
if info[0] == 0:
	sp = str(info[1]).split("\n")
	for i in sp:
		# Regular expression pattern to match IP address
		pattern = r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'
		ip_addresses = re.findall(pattern, str(i))
		if len(ip_addresses) >= 1:
			print(ip_addresses)